<template>
  <view>
    <view v-for="(item,index) in driverSort" :key="index" class="flex-row flex-center sort-item" @click="choose(item,index)">
      <text class="text-30" :class="['color-'+(index===chooseIndex?'primary':'t1')]">{{ item.label }}</text>
    </view>
  </view>
</template>

<script>
import { driverSort } from '../../index'
export default {
  name: 'SortModel',
  data() {
    return {
      driverSort,
      chooseIndex: 0
    }
  },
  methods: {
    choose(item, index) {
      this.chooseIndex = index
      this.$emit('choose', item.value)
    }
  }
}
</script>

<style scoped lang="scss">
.sort-item{
  height:100rpx;
  border-bottom:2rpx solid $color-border;
  background:#FFFFFF;
}
.sort-item:last-child{
  border:none;
}
</style>
